#include "meansknowledge.h"

namespace IAlib
{
    MeansKnowledge::MeansKnowledge()
    {
        IAlib::Knowledges::setType(IAlib::Knowledges::MeansKnowledge);
        IAlib::Knowledges::setLastCheck(0);
    }

    MeansKnowledge::MeansKnowledge(const MeansKnowledge& knowledge)
    {
        if (knowledge.getType() == IAlib::Knowledges::MeansKnowledge)
        {
            IAlib::Knowledges::setType(IAlib::Knowledges::MeansKnowledge);
            m_means_id = knowledge.m_means_id;
            m_data = knowledge.m_data;

            m_exclusive = knowledge.m_exclusive;
            m_transportable = knowledge.m_transportable;
            m_max_slot = knowledge.m_max_slot;

            m_position = knowledge.m_position;

            setLastCheck(knowledge.getLastCheck());

            m_means_type = knowledge.m_means_type;
            m_state = knowledge.m_state;
        }
        else
        {
            IAlib::Knowledges::setType(IAlib::Knowledges::MeansKnowledge);
        }

    }

    void MeansKnowledge::setPosition(const float x, const float y, const float z, const QString &work_space_id)
    {
        m_position.m_x = x;
        m_position.m_y = y;
        m_position.m_z = z;
        m_position.setWorkSpaceId(work_space_id);
    }

    QByteArray MeansKnowledge::toByteArray() const
    {
        QByteArray array;
        return array;
    }

    void MeansKnowledge::fromByteArray(QByteArray& byte_array)
    {

    }
}
